﻿using System;
using System.ServiceProcess;
using System.ComponentModel;

namespace Lypshare.ServerApp
{
	/// <summary>
	/// Installer.
	/// </summary>
    [RunInstaller(true)]
    public partial class Installer : System.Configuration.Install.Installer
    {
        // --------------------------------------------------------
        // Class Functions
        // --------------------------------------------------------


        /// <summary>
        /// Initializes a new instance of the <see cref="Lypshare.ServerApp.Installer"/> class.
        /// </summary>
        public Installer()
        {
            ServiceProcessInstaller serviceProcessInstaller 
                = new ServiceProcessInstaller();

            ServiceInstaller serviceInstaller 
                = new ServiceInstaller();

            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
            serviceProcessInstaller.Username = null;
            serviceProcessInstaller.Password = null;

            serviceInstaller.DisplayName = "Lypster Service";
            serviceInstaller.ServiceName = "Lypster Service";

            serviceInstaller.StartType = ServiceStartMode.Automatic;

            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);

            InitializeComponent();

        } // Constructor

    } // partial class Installer
} // namespace Lypshare.ServerApp